<template>
  <div>
    <div class="personal">
      <router-link to="/edit_profile">
        <div class="profile">
          <img src="user.head_img" alt />
          <div class="profile-center">
            <div class="name">
              <span
                class="iconfont iconxingbienan"
                :class="{
                  iconxingbienan: user.gender === 1,
                  iconxingbienv: user.gender === 0,
                }"
              ></span
              >{{ user.username }}
            </div>
            <div class="time">
              {{ new Date(user.create_date).toLocaleDateString() }}
            </div>
          </div>
          <span class="iconfont iconjiantou1"></span>
        </div>
      </router-link>
      <van-cell-group>
        <van-cell title="我的关注" is-link value="关注的用户" />
        <van-cell title="我的跟帖" is-link value="跟帖/回复" />
        <van-cell title="我的收藏" is-link value="文章/视频" />
        <van-cell title="设置" is-link value="" />
      </van-cell-group>
      <van-button color="#eb6112" block round>退出</van-button>
    </div>
  </div>
</template>

<script>
import { userInfo } from "../api/user";
export default {
  data() {
    return {
      user: {},
    };
  },
  created() {
    let id = localStorage.getItem("ly-14-userId");
    console.log(id);
    userInfo(id).then((res) => {
      this.user = res.data.data;
    });
  },
};
</script>

<style lang="less" scoped>
.van-cell {
  background-color: #eeeeee;
}
.van-cell[data-v-1abc445a] {
  border-bottom: 1px solid #dddddd;
}
.van-button {
  width: 90%;
  margin: 20px auto;
}
.personal {
  width: 100vw;
  height: 100vh;
  background-color: #eee;
}
a {
  color: #666;
}
.profile {
  display: flex;
  padding: 20px 10px;
  justify-content: space-between;
  align-items: center;
  border-bottom: 5px #ddd solid;

  img {
    width: (70 / 360) * 100vw;
    height: (70 / 360) * 100vw;
    border-radius: 50%;
  }

  .profile-center {
    flex: 1;
    padding: 0 10px;
  }

  .name {
    span {
      color: #75b9eb;
    }
  }

  .time {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
  }
}
</style>